require.config({
    paths: {
    	//自定义模块
    	'Table': 'modules/Table',
    	'adminlte':'./adminlte',
        // 以下的包从bower的libs目录加载
        'jquery': '../libs/jquery/dist/jquery.min',
        'bootstrap': '../libs/bootstrap/dist/js/bootstrap.min',
        'bootstrap-table': '../libs/bootstrap-table/dist/bootstrap-table.min',
        'bootstrap-validator': '../libs/bootstrap-validator/dist/js/bootstrapValidator.min',
        'datepicker': '../libs/datepicker/bootstrap-datepicker',
        'iCheck': '../libs/iCheck/icheck.min',
        'select2': '../libs/select2/select2.full.min',
    },
    map: {
        '*': {
            'css': '../libs/require-css/css.min'
        }
    },
    shim: {
    	'adminlte':{
    		deps:[
    			'jquery',
    			'css!../css/adminlte.css',
    			'css!../libs/font-awesome/css/font-awesome.min.css',
    			'css!../css/skins/_all-skins.css'
    		]
    	},
    	'bootstrap': {
    		deps:[
    			'jquery',
    			'css!../libs/bootstrap/css/bootstrap.css'
    		]
    	},
    	'bootstrap-table': {
    		deps:[
    			'jquery',
    			'css!../libs/bootstrap-table/dist/bootstrap-table.min'
    		]
    	},
    	'bootstrap-validator': {
    		deps:[
    			'jquery',
    			'css!../libs/bootstrap-validator/dist/css/bootstrapValidator.min.css'
    		]
    	},
    	'datepicker': {
    		deps:[
    			'jquery',
    			'css!../libs/datepicker/datepicker.css'
    		]
    	},
    	'iCheck': {
    		deps:[
    			'jquery',
    			'css!../libs/iCheck/all.css'
    		]
    	},
    	'select2':{
    		deps:[
    			'jquery',
    			'css!../libs/select2/select2.css'
    		]
    	}
    },
    charset: 'utf-8' // 文件编码
});

require(['jquery','adminlte', 'bootstrap'], function ($, undefined, bootstrap) {
	//初始配置
    var Config = requirejs.s.contexts._.config.config;
    //将Config渲染到全局
    window.Config = Config;
    
      // 初始化
    $(function () {
    	if (Config.jsname) {
    		require([Config.jsname], function (Controller) {
    			//初始化自执行方法
		 	 	Controller[Config.actionname] != undefined && Controller[Config.actionname]();

            }, function (e) {
                console.error(e);
                // 这里可捕获模块加载的错误
    		})
    	}
    })
});


